home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1997 / MacHack 1997.toast / Hacks / Hacks ’93 / SCSIPatch / Interfaces / CIncludes / patch.h
Encoding:
C/C++ Source or Header  |  1992-06-13  |  3.2 KB  |  111 lines  |  [TEXT/MPS ]

  1. /*
  2.  ===========================================
  3.  Copyright Paul Baxter
  4.  ===========================================
  5.  
  6.  Use:
  7.  To see if the patch is installed
  8.  
  9.  Note: This will be called by the glue for you before each call.
  10.  
  11.          short installed;
  12.         installed = SCSIPATCHAVAIL();  non zero = true
  13.  
  14.  To start recording SCSI calls
  15.          OSErr result;
  16.         result = SCSISTARTRECORD();
  17.  
  18.  To stop recording SCSI calls
  19.          OSErr result;
  20.         result = SCSISTOPRECORD();
  21.  
  22.  To reset the buffer pointer
  23.          OSErr result;
  24.         result = SCSIINITRECORD();
  25.  
  26.  To get the buffer pointer and count
  27.          OSErr result;
  28.         Ptr buffer;
  29.         long count;
  30.         result = SCSISENDRECORD(&buffer, &count);
  31.  
  32.  ===========================================
  33.                buffer format
  34.  ===========================================
  35.  scsiReset command
  36.  0000 0000
  37.    |        |__Result Code Word
  38.    |________Routine Selector Word
  39.  
  40.  scsiGet command
  41.  0001 0000
  42.    |        |__Result Code Word
  43.    |_______Routine Selector Word
  44.  
  45.  scsiSelect, scsiSelAtn commands
  46.  (scsiSelect = 0002) (scsiSelAtn = 000B)
  47.  0002 0000 0000
  48.    |    |    |__Result Code Word
  49.     |    |_______SCSI ID
  50.    |____________Routine Selector Word
  51.  
  52.  scsiCmd command
  53.  0003 0006 0800 1C32 0100 0000
  54.    |    |    |    |    |    |__Result Code Word
  55.    |    |    |____|____|_______Command bytes
  56.     |    |______________________Length of Command
  57.    |___________________________Routine Selector Word
  58.  
  59.  scsiComplete command
  60.  0004 00C1 CE20 00D2 4130 0000 2E30 0000 0000 0000
  61.    |    |    |    |    |    |    |    |    |    |__Result Code Word
  62.    |    |    |    |    |    |    |    |    |_______Message Word Result
  63.    |    |    |    |    |    |    |    |____________Status Word Result
  64.    |    |    |    |    |    |____|_________________Completetion Time
  65.    |    |    |    |____|___________________________Message Word Pointer
  66.    |    |____|_____________________________________Status Word Pointer
  67.    |_______________________________________________Routine Selector Word
  68.  
  69.  scsiRead, scsiWrite, scsiRBlind, scsiWBlind commands
  70.  (scsiRead = 0005) (scsiWrite = 0006) (scsiRBlind = 0008) (scsiWBlind = 0009)
  71.  0005 0001 001E 56D2 0000 0001 0007 0000 0000 0000 0000 0000
  72.    |    |    |    |    |    |    |    |    |    |    |    |__Result Code Word
  73.     |    |____|____|____|____|____|____|____|____|____|_______SCSIInstrs (TIB) up to scStop
  74.    |_________________________________________________________Routine Selector Word
  75.  
  76.  scsiStat command
  77.  000A 0000
  78.    |        |__Status Word
  79.    |_______Routine Selector Word
  80.  
  81.  scsiMsgIn command
  82.  000C 001E 2840 0001 0000
  83.    |    |    |    |    |__Result Code Word
  84.    |    |    |    |_______Message Word
  85.    |    |____|____________Message Word Pointer
  86.    |______________________Routine Selector Word
  87.  
  88.  scsiMsgOut command
  89.  000D 0001 0000
  90.    |    |    |__Result Code Word
  91.    |    |_______Message Word
  92.    |____________Routine Selector Word
  93.  
  94.  data_opcode command
  95.  0204 0008 0000 0000 0000 0000
  96.    |    |    |    |    |    |
  97.    |    |    |____|____|____|_Data
  98.     |    |_____________________Data Count
  99.    |__________________________Routine Selector Word
  100.  
  101.  
  102. */
  103.  
  104. #define data_opcode    516
  105.  
  106. pascal short SCSIPATCHAVAIL(void);
  107. pascal OSErr SCSISTARTRECORD(void);
  108. pascal OSErr SCSISTOPRECORD(void);
  109. pascal OSErr SCSIINITRECORD(void);
  110. pascal OSErr SCSISENDRECORD(Ptr* buffer, long* count);
  111.